import React from 'react';
import { Text, Dimensions } from 'react-native';

const ResponsiveText = ({ style, children, fontSizePercent }) => {
  const windowWidth = Dimensions.get('window').width;
  const responsiveStyle = {
    fontSize: windowWidth * (fontSizePercent / 100),
    ...style,
  };

  return <Text style={responsiveStyle}>{children}</Text>;
};

export default ResponsiveText;